<?php

namespace app\api\controller;
use app\api\logic\LinXingOrderLogic;
use app\api\logic\TestLogic;
use  app\common\controller\DBase;
use app\api\logic\CheckLogic;
use app\api\logic\ApiAdvLogic;
use app\customer\logic\EmailTagLogic;
use app\customer\logic\OrderRefundLogic;
use app\order\logic\CheckbillLogic;

class Check extends DBase
{


    /**
     * @desc   获取广告费消费方法
     * @author xx
     * @date   2024-10-08
     */
    public function get_advertise_info(){
        $params     = $this->request->post();
        $res        =  (new ApiAdvLogic())->integrated_get_fb_consumer($params);
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }


    /**
     * @desc   图片区域迁移
     * @author xx
     * @date   2024-10-11
     */
    public function remove_image(){
        $params     = $this->request->post();
        $res        =  (new CheckLogic())->remove_image($params);
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }


    /**
     * @desc   空中云慧数据获取
     * @author xx
     * @date   2024-10-19
     */
    public function get_airwallex_info(){
        $params     = $this->request->post();
        $res        =  (new CheckLogic())->get_airwallex_info($params);
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }



    /**
     * @desc   空中云慧数据获取
     * @author xx
     * @date   2024-10-19
     */
    public function get_airwallex_list(){
        $params     = $this->request->post();
        $res        =  (new CheckLogic())->get_airwallex_list();
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }


    /**
     * @desc   获取token数据
     * @author xx
     * @date   2024-11-14
     */
    public function get_google_token(){
        $params     = $this->request->post();
        $res        =  (new CheckLogic())->get_google_token($params);
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }


    /**
     * @desc   获取code数据
     * @author xx
     * @date   2024-11-15
     */
    public function get_authorization_code(){
        $res        =  (new CheckLogic())->get_authorization_code();
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }


    /**
     * @desc   获取refresh_code数据
     * @author xx
     * @date   2024-11-16
     */
    public function get_access_token(){
        $res    =  (new CheckLogic())->get_access_token();
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }

    /**
     * @desc   测试
     * @author xx
     * @date   2024-11-22
     */
    public function get_webhook_test(){
        $params =  $this->request->post();
        $res    =  (new CheckLogic())->get_track_info($params);
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }


    /**
     * @desc   谷歌账户拉取某一天的数据
     * @author xx
     * @date   2024-11-16
     */
    public function updateCostMicros(){
        $params     = $this->request->get();
        $res    =  (new CheckLogic())->updateCostMicros($params);
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }


    /**
     * @desc   FB账户拉取某一天的数据
     * @author xx
     * @date   2024-11-16
     */
    public function updateFbCost(){
        $params     = $this->request->get();
        $res    =  (new CheckLogic())->updateFbCost($params);
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }

    /**
     * @desc   刷新fb的token信息
     * @author xx
     * @date   2025-02-12
     */
    public function refreshAccessToken(){
        $params     = $this->request->get();
        $res    =  (new CheckLogic())->refreshAccessToken($params);
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }

    public function track_4px_sign(){
        $params     = $this->request->get();
        $res    =  (new CheckLogic())->track_4px_sign($params);
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }

    /**
     * @desc    4px获取物流状态信息
     * @date    2025-07-16
     * @author  luckyXiong
     */
    public function track_4px(){
        $params     = $this->request->post();
        $res    =  (new CheckLogic())->track_4px($params);
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }




    /**
     * @desc   tik账户拉取某一天的数据
     * @author xx
     * @date   2024-12-11
     */
    public function updateTikCost(){
        $params     = $this->request->get();
        $res    =  (new CheckLogic())->updateTikCost($params);
        return $this->jsonMessage(200, true, "获取成功!", $res);
    }



    /**
     * @desc   广告数据初始记录定时写入，每天下午3点执行
     * @author xx
     * @date   2024-12-09
     */
    public function insert_day_advertise(){
        $params     = $this->request->get();
        $res    =  (new CheckLogic())->insert_day_advertise($params);
        return $this->jsonMessage(200, true, "操作成功!", $res);
    }


    /**
     * @desc   广告需要跑数据的生产方法
     * @author xx
     * @date   2024-12-09
     */
    public function day_advertise_produce(){
        $params     = $this->request->get();
        $res    =  (new CheckLogic())->day_advertise_produce();
        return $this->jsonMessage(200, true, "操作成功!", $res);
    }


    public function get_advertise_consumer(){
        $params     = $this->request->post();
        $res        =  (new CheckLogic())->get_advertise_consumer($params);
        return $this->jsonMessage(200, true, "操作成功!", $res);
    }



    /**
     * @desc   历史track数据拉取
     * @author luckyXiong
     * @date   2024-12-28
     */
    public function track_history_produce(){
        $params     = $this->request->post();
        $res    =  (new CheckLogic())->track_history_produce();
        return $this->jsonMessage(200, true, "操作成功!", $res);
    }




    /**
     * @desc    获取某个店铺的ROI数据
     * @author  luckyXiong
     * @date    2025-01-06
     */
    public function get_Woobilly_Roi(){
        $params = $this->request->get();
        $res    =  (new CheckLogic())->getShopRoi($params);
        return $this->jsonMessage(200, true, "操作成功!", $res);
    }


    /**
     * @desc    获取kisslove店铺的ROI数据
     * @author  luckyXiong
     * @date    2025-01-08
     */
    public function getkissloveShop(){
        $params = $this->request->get();
        $res    =  (new CheckLogic())->getkissloveShop($params);
        return $this->jsonMessage(200, true, "操作成功!", $res);
    }

    /**
     * @desc   发送邮件消息
     * @author luckyXiong
     * @date   2025-01-24
     */
    public function send_email(){
        $params = $this->request->post();
        htmlLog(['params'=>$params],OPERATE_LOG . date('Ym') . '/send_email/' . date('Ymd') . '.txt');
        return  (new CheckLogic())->send_email($params);
    }


    /**
     * @desc   添加标签
     * @author luckyXiong
     * @date   2025-01-24
     */
    public function add_tag(){
        $params = $this->request->post();
        htmlLog(['params'=>$params],OPERATE_LOG . date('Ym') . '/add_tag/' . date('Ymd') . '.txt');
        return  (new CheckLogic())->add_tag($params);
    }

    /**
     * @desc   删除标签
     * @author luckyXiong
     * @date   2025-01-24
     */
    public function del_tag(){
        $params = $this->request->post();
        htmlLog(['params'=>$params],OPERATE_LOG . date('Ym') . '/del_tag/' . date('Ymd') . '.txt');
        return  (new CheckLogic())->del_tag($params);
    }


    /**
     * @desc   删除标签
     * @author luckyXiong
     * @date   2025-01-24
     */
    public function batch_refund_create(){
        $params = $this->request->post();
        htmlLog(['params'=>$params],OPERATE_LOG . date('Ym') . '/batch_refund_create/' . date('Ymd') . '.txt');
        return  (new CheckLogic())->batch_refund_create($params);
    }


    /**
     * @desc   更新海外仓库存
     * @author luckyXiong
     * @date   2025-04-08
     */
    public function update_hwc_inventory(){
         $params = $this->request->get();
         $res    = (new CheckLogic())->update_hwc_inventory($params);
         return $this->jsonMessage(200, true, "操作成功!", $res);
    }


    /**
     * @desc   发送邮件消息
     * @author luckyXiong
     * @date   2025-01-24
     */
    public function email_reply(){
        $params = $this->request->post();
        (new CheckLogic())->email_reply($params);
        return $this->jsonMessage(200, true, "操作成功!", '');
    }



    /**
     * @desc   退款消费
     * @author luckyXiong
     * @date   2025-02-24
     */
    public function order_refund_consumer(){
        $params = $this->request->post();
        (new OrderRefundLogic())->order_refund_consumer($params);
        return $this->jsonMessage(200, true, "操作成功!", '');
    }



    /**
     * @desc   退款消费
     * @author luckyXiong
     * @date   2025-04-09
     */
    public function consumer_hwc_inventory(){
        $params = $this->request->post();
        (new CheckLogic())->consumer_hwc_inventory($params);
        return $this->jsonMessage(200, true, "操作成功!", '');
    }


    /**
     * @desc   根据spu获取产品类型
     * @author luckyXiong
     * @date   2025-06-11
     */
    public function get_product_type(){
        $params = $this->request->post();
        return (new LinXingOrderLogic())->get_product_type($params);
    }



}